package test;

import java.util.Scanner;
import java.util.Stack;

/**
 * @author 郝文雪
 * @date 2022/9/14 22:12
 * @Description Test
 */
public class guang1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] str = new String[n];
        sc.nextLine();
        for (int i = 0; i < n; i++) {
            str[i] = sc.nextLine();
        }

        for (int j = 0; j < str.length; j++) {
            if(str[j].length()<2){
                System.out.println("No");
                continue;
            }
            char[] s = str[j].toCharArray();
            int k = 0;
            Stack<Character> stack = new Stack<>();
            for (int i = 0; i < s.length; i++) {
                if (stack.isEmpty()) {
                    stack.push(s[i]);
                }else{
                    if(stack.peek()==s[i]){
                        stack.pop();
                        k++;
                    }else{
                        stack.push(s[i]);
                    }
                }

            }
            if (k % 2 == 0) {
                System.out.println("No");
            } else {
                System.out.println("Yes");
            }
        }
    }
}
